<%@include file="/header.jsp"%>
<%@page import="common.JspUtil"%>
<%@ page language="java" contentType="text/html" %>
<%@ page import="dataGateway.BidTable" %>
<%@ page import="domainLogic.Bid" %>
<jsp:useBean id="newBid" class="domainLogic.Bid" scope="request" />
<jsp:setProperty name="newBid" property="*"/>
<%
	if(!newBid.getUserId().equals(JspUtil.getLoggedInUserId(session)))
{
	out.println(JspUtil.makeErrorMsg("Invalid access!"));
	return;
}

if(domainLogic.BiddingService.getInstance().createNewBid(newBid, out) == true)
{
	out.println(JspUtil.makeErrorMsg("You succeed to bid!", 
			common.JspUtil.URL_CONTENT_PAGE+"/items/viewItemDetail.jsp?itemId="+newBid.getItemId()));
}
%>
<%@include file="/footer.jsp"%>